package com.mongo.pattern;

/**
 * @author: simon
 * @date: 2019/8/5 17:06
 */
public class Main {
    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(3);
        Book book1 = new Book("Java设计模式");
        Book book2 = new Book("Java程序设计");
        Book book3 = new Book("Java性能优化");
        bookShelf.addBook(book1);
        bookShelf.addBook(book2);
        bookShelf.addBook(book3);
        Iterator iterator = bookShelf.iterator();
        while (iterator.hasNext()){
            Book book = (Book) iterator.next();
            System.out.println(book.getName());
        }
    }
}
